<?

		// 지역명입니다.
		// 보여주고 싶은 곳의 지역명 아래에서 찾아 $DefaultRegion 에 지정하세요
		
		global $regcode;
		
		// 서울.경기 지역
		$regcode["서울"]	= "11B10101";
		$regcode["양주"]	= "11B20304";
		$regcode["남양주"]	= "11B25302";
		$regcode["경기광주"]= "11B20702";
		$regcode["강화"]	= "11B20101";
		$regcode["동두천"]	= "11B20401";
		$regcode["양평"]	= "11B20503";
		$regcode["성남"]	= "11B20605";
		$regcode["김포"]	= "11B20102";
		$regcode["연천"]	= "11B20402";
		$regcode["수원"]	= "11B20601";
		$regcode["평택"]	= "11B20606";
		$regcode["시흥"]	= "11B20202";
		$regcode["포천"]	= "11B20403";
		$regcode["안양"]	= "11B20602";
		$regcode["인천"]	= "11B20201";
		$regcode["의정부"]	= "11B20301";
		$regcode["가평"]	= "11B20404";
		$regcode["오산"]	= "11B20603";
		$regcode["문산"]	= "11B20305";
		$regcode["고양"]	= "11B20302";
		$regcode["구리"]	= "11B20501";
		$regcode["화성"]	= "11B20604";
		$regcode["파주"]	= "11B20303";
		$regcode["이천"]	= "11B20701";
		
		// 서해5도
		$regcode["백령도"] 	= "11A00101";
		$regcode["연평도"] 	= "11A00102";
		$regcode["소청도"] 	= "11A00103";
		
		// 충청북도
		$regcode["충주"] 	= "11C10101";
		$regcode["진천"] 	= "11C10102";
		$regcode["음성"] 	= "11C10103";
		$regcode["제천"] 	= "11C10201";
		$regcode["단양"] 	= "11C10202";
		$regcode["청주"] 	= "11C10301";
		$regcode["보은"] 	= "11C10302";
		$regcode["괴산"] 	= "11C10303";
		$regcode["추풍령"] 	= "11C10401";
		$regcode["영동"] 	= "11C10402";
		$regcode["옥천"] 	= "11C10403";
		
		// 충청남도
		$regcode["서산"] 	= "11C20101";
		$regcode["공주"] 	= "11C20402";
		$regcode["태안"] 	= "11C20102";
		$regcode["부여"] 	= "11C20501";
		$regcode["당진"] 	= "11C20103";
		$regcode["청양"] 	= "11C20502";
		$regcode["홍성"] 	= "11C20104";
		$regcode["논산"] 	= "11C20602";
		$regcode["보령"] 	= "11C20201";
		$regcode["아산"] 	= "11C20302";
		$regcode["서천"] 	= "11C20202";
		$regcode["금산"] 	= "11C20601";
		$regcode["천안"] 	= "11C20301";
		$regcode["대전"]	= "11C20401";
		
		// 강원영서
		$regcode["철원"]	= "11D10101";
		$regcode["화천"]	= "11D10102";
		$regcode["인제"]	= "11D10201";
		$regcode["양구"]	= "11D10202";
		$regcode["홍천"]	= "11D10302";
		$regcode["원주"]	= "11D10401";
		$regcode["횡성"]	= "11D10402";
		$regcode["영월"]	= "11D10501";
		$regcode["정선"]	= "11D10502";
		$regcode["평창"]	= "11D10503";
		$regcode["춘천"]	= "11D10301";
	
		// 강원영동
		$regcode["대관령"]	= "11D20201";
		$regcode["삼척"]	= "11D20602";
		$regcode["태백"]	= "11D20301";
		$regcode["속초"]	= "11D20401";
		$regcode["고성"]	= "11D20402";
		$regcode["양양"]	= "11D20403";
		$regcode["강릉"]	= "11D20501";
		$regcode["동해"]	= "11D20601";
		
		// 전라북도
		$regcode["전주"]	= "11F10201";
		$regcode["익산"]	= "11F10202";
		$regcode["정읍"]	= "11F10203";
		$regcode["장수"]	= "11F10301";
		$regcode["무주"]	= "11F10302";
		$regcode["남원"]	= "11F10401";
		$regcode["임실"]	= "11F10402";
		$regcode["순창"]	= "11F10403";
		$regcode["진안"]	= "11F10303";
		$regcode["군산"]	= "11F10501";
		$regcode["김제"]	= "11F10502";
		$regcode["고창"]	= "11F10601";
		$regcode["부안"]	= "11F10602";
		
		// 전라남도
		$regcode["광주"]	= "11F20501";
		$regcode["완도"]	= "11F20301";
		$regcode["해남"]	= "21F20302";
		$regcode["강진"]	= "11F20303";
		$regcode["장성"]	= "11F20502";
		$regcode["순천"]	= "11F20405";
		$regcode["목포"]	= "21F20801";
		$regcode["장흥"]	= "11F20304";
		$regcode["나주"]	= "11F20503";
		$regcode["순천"]	= "11F20603";
		$regcode["영암"]	= "21F20802";
		$regcode["여수"]	= "11F20401";
		$regcode["담양"]	= "11F20504";
		$regcode["함평"]	= "21F20101";
		$regcode["신안"]	= "21F20803";
		$regcode["광양"]	= "11F20402";
		$regcode["구례"]	= "11F20601";
		$regcode["영광"]	= "21F20102";
		$regcode["무안"]	= "21F20804";
		$regcode["고흥"]	= "11F20403";
		$regcode["곡성"]	= "11F20602";
		$regcode["진도"]	= "21F20201";
		$regcode["보성"]	= "11F20404";
		$regcode["흑산도"]	= "11F20701";
		
		// 경상북도
		$regcode["울진"] = "11H10101";
		$regcode["춘양"] = "11H10402";
		$regcode["고령"] = "11H10604";
		$regcode["상주"] = "11H10302";
		$regcode["영덕"] = "11H10102";
		$regcode["영양"] = "11H10403";
		$regcode["성주"] = "11H10605";
		$regcode["구미"] = "11H10602";
		$regcode["포항"] = "11H10201";
		$regcode["안동"] = "11H10501";
		$regcode["대구"] = "11H10701";
		$regcode["경주"] = "11H10202";
		$regcode["의성"] = "11H10502";
		$regcode["영천"] = "11H10702";
		$regcode["문경"] = "11H10301";
		$regcode["청송"] = "11H10503";
		$regcode["경산"] = "11H10703";
		$regcode["예천"] = "11H10303";
		$regcode["김천"] = "11H10601";
		$regcode["청도"] = "11H10704";
		$regcode["영주"] = "11H10401";
		$regcode["군위"] = "11H10603";
		$regcode["칠곡"] = "11H10705";
		$regcode["대구"] = "11H10701";
	
		// 경상남도	
		$regcode["김해"]	= "11H20304";
		$regcode["하동해안"]= "11H20406";
		$regcode["하동내륙"]= "11H20702";
		$regcode["창녕"]	= "11H20604";
		$regcode["양산"]	= "11H20102";
		$regcode["통영"]	= "11H20401";
		$regcode["함양"]	= "11H20501";
		$regcode["진주"]	= "11H20701";
		$regcode["부산"]	= "11H20201";
		$regcode["사천"]	= "11H20402";
		$regcode["거창"]	= "11H20502";
		$regcode["창원"]	= "11H20301";
		$regcode["거제"]	= "11H20403";
		$regcode["합천"]	= "11H20503";
		$regcode["산청"]	= "11H20703";
		$regcode["밀양"]	= "11H20601";
		$regcode["고성"]	= "11H20404";
		$regcode["의령"]	= "11H20602";
		$regcode["진해"]	= "11H20303";
		$regcode["마산"]	= "11H20302";
		$regcode["남해"]	= "11H20405";
		$regcode["함안"]	= "11H20603";
		$regcode["울산"]	= "11H20101";
		
		// 울릉, 독도
		$regcode["울릉"]	= "11E00101";
		$regcode["독도"]	= "11E00102";
	
		// 제주도
		$regcode["성산포"]	= "11G00101";                
		$regcode["제주"]	= "11G00201";                
		$regcode["윗세오름"]= "11G00301";                
		$regcode["고산"]	= "11G00501";                
		$regcode["서귀포"]	= "11G00401";                
	
	function extract_img($str)
	{
		if (strpos($str, ".gif") > 0)
		{
			list($front, $tail) = spliti("[a-z0-9_]+\.gif", $str);
	
			$rt = substr($str, strlen($front), strlen($str)-strlen($tail)-strlen($front));
		}
		else if (strpos($str, ".swf") > 0)
		{
			list($front, $tail) = spliti("sub[a-z0-9_]+\.swf", $str);
	
			$rt = substr($str, strlen($front), strlen($str)-strlen($tail)-strlen($front));
			
			$rt = str_replace("sub", "icon_", $rt);
			$rt = str_replace(".swf", ".gif", $rt);
		}
	
		return $rt;
	}
	
	function loaddata($RegionFile)
	{
		global $wdata;
	
		if (!file_exists($RegionFile))
			return false;
			
		$fd = fopen($RegionFile, "r");
		if($fd == FALSE)
			return false;
			
		$wdata[reg] = trim(fgets($fd, 512));
		$wdata[date] = trim(fgets($fd, 512));
		$wdata[img0] = trim(fgets($fd, 512));
		$wdata[txt0] = trim(fgets($fd, 512));
		$wdata[lo0] = trim(fgets($fd, 512));
		$wdata[hi0] = trim(fgets($fd, 512));
		//$wdata[temp0] = trim(fgets($fd, 512));
		$wdata[am0] = trim(fgets($fd, 512));
		$wdata[pm0] = trim(fgets($fd, 512));
		//$wdata[rain0] = trim(fgets($fd, 512));
	
		$wdata[img1] = trim(fgets($fd, 512));
		$wdata[txt1] = trim(fgets($fd, 512));
		$wdata[lo1] = trim(fgets($fd, 512));
		$wdata[hi1] = trim(fgets($fd, 512));
		//$wdata[temp1] = trim(fgets($fd, 512));
		$wdata[am1] = trim(fgets($fd, 512));
		$wdata[pm1] = trim(fgets($fd, 512));
		//$wdata[rain1] = trim(fgets($fd, 512));
	
		$wdata[img2] = trim(fgets($fd, 512));
		$wdata[txt2] = trim(fgets($fd, 512));
		$wdata[lo2] = trim(fgets($fd, 512));
		$wdata[hi2] = trim(fgets($fd, 512));
		//$wdata[temp2] = trim(fgets($fd, 512));
		$wdata[am2] = trim(fgets($fd, 512));
		$wdata[pm2] = trim(fgets($fd, 512));
		//$wdata[rain2] = trim(fgets($fd, 512));
		$wdata[date0] = trim(@fgets($fd, 512));
		$wdata[date1] = trim(@fgets($fd, 512));
		$wdata[date2] = trim(@fgets($fd, 512));
		fclose($fd);
		
		return true;
	}
	
	function savedata($RegionFile)
	{
		global $wdata;
	
		$fd = fopen($RegionFile, "w");
		if($fd == FALSE)
			return false;
			
		fputs($fd, $wdata[reg]."\n");
		fputs($fd, $wdata[date]."\n");
		fputs($fd, $wdata[img0]."\n");
		fputs($fd, $wdata[txt0]."\n");
		fputs($fd, $wdata[lo0]."\n");
		fputs($fd, $wdata[hi0]."\n");
		//fputs($fd, $wdata[temp0]."\n");
		fputs($fd, $wdata[am0]."\n");
		fputs($fd, $wdata[pm0]."\n");
		//fputs($fd, $wdata[rain0]."\n");
		fputs($fd, $wdata[img1]."\n");
		fputs($fd, $wdata[txt1]."\n");
		fputs($fd, $wdata[lo1]."\n");
		fputs($fd, $wdata[hi1]."\n");
		//fputs($fd, $wdata[temp1]."\n");
		fputs($fd, $wdata[am1]."\n");
		fputs($fd, $wdata[pm1]."\n");
		//fputs($fd, $wdata[rain1]."\n");
		fputs($fd, $wdata[img2]."\n");
		fputs($fd, $wdata[txt2]."\n");
		fputs($fd, $wdata[lo2]."\n");
		fputs($fd, $wdata[hi2]."\n");
		//fputs($fd, $wdata[temp2]."\n");
		fputs($fd, $wdata[am2]."\n");
		fputs($fd, $wdata[pm2]."\n");
		//fputs($fd, $wdata[rain2]."\n");
		fputs($fd, $wdata[date0]."\n");
		fputs($fd, $wdata[date1]."\n");
		fputs($fd, $wdata[date2]."\n");
		fclose($fd);
		
		return true;
	}
	
	function getkmaextra()
	{
		global $wdata, $date_format, $unit_temp, $unit_rain;
		
		$wdata[temp0] = nmerge($wdata[lo0], $wdata[hi0], $unit_temp);
		$wdata[temp1] = nmerge($wdata[lo1], $wdata[hi1], $unit_temp);
		$wdata[temp2] = nmerge($wdata[lo2], $wdata[hi2], $unit_temp);
		$wdata[rain0] = nmerge($wdata[am0], $wdata[pm0], $unit_rain);
		$wdata[rain1] = nmerge($wdata[am1], $wdata[pm1], $unit_rain);
		$wdata[rain2] = nmerge($wdata[am2], $wdata[pm2], $unit_rain);
		                                
		$wdata[txt0] .= iconvWrapper("UTF-8", "EUC-KR", "||예상기온 : 최저 $wdata[lo0]'C, 최고 $wdata[hi0]'C").
		                iconvWrapper("UTF-8", "EUC-KR", "||강수확률 : 오전 $wdata[am0]%, 오후 $wdata[pm0]%");
		$wdata[txt1] .= iconvWrapper("UTF-8", "EUC-KR", "||예상기온 : 최저 $wdata[lo1]'C, 최고 $wdata[hi1]'C").
		                iconvWrapper("UTF-8", "EUC-KR", "||강수확률 : 오전 $wdata[am1]%, 오후 $wdata[pm1]%");
		$wdata[txt2] .= iconvWrapper("UTF-8", "EUC-KR", "||예상기온 : 최저 $wdata[lo2]'C, 최고 $wdata[hi2]'C");
	
		setlocale(LC_TIME, "ko_KR");
		$wdata[date] = strftime (iconvWrapper("UTF-8", "EUC-KR", $date_format));
		setlocale(LC_TIME, "C");
	
	}
	
	function nmerge($lo, $hi, $unit)
	{
		$formlo = ereg("[0-9\-]+", $lo);
		$formhi = ereg("[0-9\-]+", $hi);
	
		$str = $lo.($formlo && $formhi ? "/" :"").$hi.($formlo || $formhi ? $unit:"");
		return $str;
	}	
?>
<?	
	function GetRegionFile($RegionData)
	{

		global $pluginURL;
		global $regcode;
		global $UserHomePath;
		
		$RegionFile = $_SERVER['DOCUMENT_ROOT'].$pluginURL."/".$regcode[$RegionData].".dat";
		return $RegionFile;
	}

	function NeedRefresh($RegionData)
	{
		global $pluginURL;
		global $wdata, $regcode, $ExpireTime;
	
		$RegionFile = GetRegionFile($RegionData);
	
		if (!file_exists($RegionFile))
			return true;
		
		$fc = filemtime($RegionFile);
		$ti = time();
		$wdata[age] = ($ti - $fc);
	
		if ($wdata[age] > $ExpireTime)
			return true;
		
		return false;
	}

	function GetWeatherData($ConnectHost, $ConnectPath, $ConnectPort, $ConnectTimeout, $RegionData, &$ResultData)
	{
		
		global $wdata, $regcode;
		
		$debug = false;
		
		$fp = @fsockopen ($ConnectHost, $ConnectPort, $ErrCode, $ErrMsg, $ConnectTimeout);
		
		if ($debug) print("<xmp>");
		
		if(!$fp)
		{
			$ResultData = "기상청 서버에 접속할수 없습니다 [".$ErrMsg."]";
			return false;
		}
		
		$ReqURL = $ConnectPath."?region3=".$regcode[$RegionData];

		$Result = @fputs ($fp, "GET ".$ReqURL." HTTP/1.0\r\nHost: ".$ConnectHost."\r\n\r\n");
		
		if ( !isset($Result) || $Result == false || $Result == 0 ) 
		{
			fclose ($fp);
			$ResultData = "기상청 홈페이지에 접속할수 없습니다";
			return false;
		}	
		
		$rtcode = @fgets($fp, 128);
		if(!isset($rtcode) || strstr($rtcode, "200") == 0)
		{
			fclose ($fp);
			$ResultData = "기상청 날씨 페이지를 열수 없습니다";
			return false;
		}
	 
    $line = 1;
    $seq = 0;
    $trigger = false;
    $rawdata = array();
	    	 
	  if ($debug) print("<li>rt=".$rtcode);
	  
		for($line = 1; !feof($fp); $line++)
		{
			$str = trim(fgets($fp,512));
	
			if ($str == "")
			{
				$line--;
				continue;
			}
	
			if (eregi(iconvWrapper("UTF-8", "EUC-KR", "[0-9]{4}년[ ]?[0-9]{1,2}월[ ]?[0-9]{1,2}일[ ]?[0-9]{1,2}시[ ]?발표"), $str))
			{
				$rawdata[$seq++] = strip_tags($str);
				if ($debug) print("----".strip_tags($str)."----\n");
			}
			else if (eregi(iconvWrapper("UTF-8", "EUC-KR", "[0-9]{1,2}월[ ]?[0-9]{1,2}일"), $str))
			{
				$tmp = trim(strip_tags($str));
				list($mon, $tmp) = split(iconvWrapper("UTF-8", "EUC-KR", "월"), $tmp);
				list($dom, $tmp) = split(iconvWrapper("UTF-8", "EUC-KR", "일"), $tmp);
				$rawdata[$seq++] = $mon."/".$dom;
				if ($debug) print("[".trim(strip_tags($str))."]\n");
			}
			else if (eregi("<embed src=", $str))
			{
				$tmp = split("\"", $str, 3);
				$rawdata[$seq++] = $tmp[1];
				$trigger = true;
				if ($debug) print("[".$tmp[1]."]\n");
			}
			else if ($trigger && strncmp($str, "<td ", 4) == 0)
			{
				$tmp = trim(strip_tags($str));
				if (strlen($tmp) == 0) 
					continue;
				$rawdata[$seq++] = $tmp;
				if ($debug) print("{".$tmp."}\n");
			}
		}
	
		$wdata[age] = 0;
		$wdata[path] = iconvWrapper("UTF-8", "EUC-KR", $ConnectPath);
		$wdata[reg] = iconvWrapper("UTF-8", "EUC-KR", $RegionData);
		$wdata["date"] = $rawdata[0];
	 
		for($i = 0; $i < 3; $i++)
		{
			$wdata[date.($i)] = $rawdata[$i*13+1];
			$wdata[img.($i)] = extract_img($rawdata[$i*13+2]);
			$wdata[lo.($i)] = $rawdata[$i*13+6];
			$wdata[hi.($i)] = $rawdata[$i*13+7];
			$wdata[am.($i)] = $rawdata[$i*13+11];
			$wdata[pm.($i)] = $rawdata[$i*13+12];
			$wdata[txt.($i)] = $rawdata[$i*13+13];
		}
	
		fclose ($fp);
	
		if ($debug) print("</xmp>");
		return true;
	}
	
	
	function ShowWeatherForecast_L4U($target) 
	{ 
	
//		return "";
		
		global $pluginURL, $service;
		global $ExpireTime, $DefaultSkin;
		global $regcode, $wdata;
		global $date_format, $unit_temp, $unit_rain;


		// 일기정보를 가져올 서버와 페이지를 설정한다
		$ConnectHost = "www.kma.go.kr";
		$ConnectPath = "/weather/dl_forecast.jsp";
		$ConnectPort = 80;
		$ConnectTimeout = 5;
	
		$date_format = "%m/%d %a %H시 발표";
		$unit_temp = "'C";
		$unit_rain = "%";

	
		$DefaultRegion = "서울";		// 일기예보를 보여줄 지역을 선택합니다. $regcode 를 참조
		$DefaultSkin = "default";		// SKIN 폴더를 지정합니다
		$ExpireTime = 3600;					// 날씨 정보를 몇 초마다 갱신할지를 설정한다
		
		$ResultData = "";
		
		if(NeedRefresh($DefaultRegion) == true)
		{
			$Result = GetWeatherData($ConnectHost, $ConnectPath, $ConnectPort, $ConnectTimeout, $DefaultRegion, $ResultData);
			if($Result == false)
				return $ResultData;
		
			$RegionFile = GetRegionFile($DefaultRegion);
			if(savedata($RegionFile) == false)
				return "날씨 데이터 저장에 실패하였습니다.\n파일 쓰기 권한이 있는지 확인하세요";
		}
		
		// 날씨 정보를 저장한 파일을 읽어들인다
		$RegionFile = GetRegionFile($DefaultRegion);
		if(loaddata($RegionFile) == false)
			return "날씨 데이터 파싱에 실패하였습니다";
			
		getkmaextra();
	
	
		// SKIN 파일을 구성합니다
		
		$ImagePath = $pluginURL."/skin/".$DefaultSkin."/img/";
		$MainPath= $_SERVER['DOCUMENT_ROOT'].$pluginURL."/skin/".$DefaultSkin."/main.html";
		if (!file_exists($MainPath))
			return $DefaultSkin." SKIN 파일이 존재하지 않습니다";
			
		$f = fopen($MainPath, r);
		$data = fread($f, filesize($MainPath));
		fclose($f);	
		
		$form_begin = "<form action='' method=post name='happyweatherform'>";
		$form_end   = "</form>";
		$select = $wdata[reg];
		
		$data = str_replace("[form_begin]", $form_begin, $data);
		$data = str_replace("[form_end]", $form_end, $data);
		
		$data = str_replace("[reg]",  iconvWrapper("EUC-KR", "UTF-8", $select), $data);
		$data = str_replace("[date]", iconvWrapper("EUC-KR", "UTF-8", $wdata[date]), $data);
		
		$data = str_replace("[img0]", $ImagePath.$wdata[img0], $data);
		$data = str_replace("[txt0]", iconvWrapper("EUC-KR", "UTF-8", str_replace("||", "\n", $wdata[txt0])), $data);
		$data = str_replace("[lo0]", $wdata[lo0], $data);
		$data = str_replace("[hi0]", $wdata[hi0], $data);
		$data = str_replace("[am0]", iconvWrapper("EUC-KR", "UTF-8", $wdata[am0]), $data);
		$data = str_replace("[pm0]", iconvWrapper("EUC-KR", "UTF-8", $wdata[pm0]), $data);
		$data = str_replace("[temp0]", $wdata[temp0], $data);
		$data = str_replace("[rain0]", $wdata[rain0], $data);
		$data = str_replace("[date0]", $wdata[date0], $data);
	
		$data = str_replace("[img1]", $ImagePath.$wdata[img1], $data);
		$data = str_replace("[txt1]", iconvWrapper("EUC-KR", "UTF-8", str_replace("||", "\n", $wdata[txt1])), $data);
		$data = str_replace("[lo1]", $wdata[lo1], $data);
		$data = str_replace("[hi1]", $wdata[hi1], $data);
		$data = str_replace("[am1]", iconvWrapper("EUC-KR", "UTF-8", $wdata[am1]), $data);
		$data = str_replace("[pm1]", iconvWrapper("EUC-KR", "UTF-8", $wdata[pm1]), $data);
		$data = str_replace("[temp1]", $wdata[temp1], $data);
		$data = str_replace("[rain1]", $wdata[rain1], $data);
		$data = str_replace("[date1]", $wdata[date1], $data);

		$data = str_replace("[img2]", $ImagePath.$wdata[img2], $data);
		$data = str_replace("[txt2]", iconvWrapper("EUC-KR", "UTF-8", str_replace("||", "\n", $wdata[txt2])), $data);
		$data = str_replace("[lo2]", $wdata[lo2], $data);
		$data = str_replace("[hi2]", $wdata[hi2], $data);
		$data = str_replace("[am2]", iconvWrapper("EUC-KR", "UTF-8", $wdata[am2]), $data);
		$data = str_replace("[pm2]", iconvWrapper("EUC-KR", "UTF-8", $wdata[pm2]), $data);
		$data = str_replace("[temp2]", $wdata[temp2], $data);
		$data = str_replace("[rain2]", $wdata[rain2], $data);
		$data = str_replace("[date2]", $wdata[date2], $data);
	
		$data = str_replace("[age]", $wdata[age], $data);
		
		$age_h = floor($wdata[age]/(60*60));
		$age_m = round($wdata[age]/60-$age_h*60, 0);
		
		if ($age_h == 0)
			$age = $age_m."분";
		else
			$age = $age_h.":".$age_m;
		$data = str_replace("[age_txt]", $age, $data);
		
		$data = str_replace("[skin]", $pluginURL."/skin/".$skin, $data);
		$data = str_replace("[help]", $pluginURL."/help.php?weather_url=".$pluginURL."&weather_skin=".$DefaultSkin, $data);
		
		list($fore, $tmp) = split("\[force_expire_begin\]", $data);
		list($anch, $back) = split("\[force_expire_end\]", $tmp);		
		
		$data = $fore.$back;
		
		return $data;		
		
	}
?>